home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / basictut.arc / AVERAGE.BAS < prev    next >
BASIC Source File  |  1989-01-07  |  384b  |  8 lines

  1. 10 DATA 76,93,88,69,100,75,84,999
  2. 20 READ NUM:IF NUM=999 THEN GOTO 100 'get a number, check if last number
  3. 30 COUNT=COUNT+1        'count the number of numbers
  4. 40 SUM=SUM+NUM          'find the sum of the numbers
  5. 50 GOTO 20              'get the next number
  6. 100 PRINT "The sum of the";COUNT;"numbers is";SUM
  7. 110 PRINT "and the average is";SUM/COUNT
  8.             'get the next n